<?php /*a:3:{s:62:"D:\phpStudy\WWW\tp5\application\index\view\index\about_me.html";i:1553175733;s:60:"D:\phpStudy\WWW\tp5\application\index\view\index\header.html";i:1550326364;s:60:"D:\phpStudy\WWW\tp5\application\index\view\index\footer.html";i:1550326435;}*/ ?>
 <!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>广州商学院lms</title>
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" src="/static/lib/layui/layui.js"></script>
    <script type="text/javascript" src="/static/js/jquery.js"></script>
    <link rel="stylesheet" type="text/css" href="/static/lib/layui/css/layui.css" />
    <style>
        body{
            background: #F7F7F7;
        }
       
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">广州商学院-lms</div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
            <li class="layui-nav-item"><a href="<?php echo url('index'); ?>">首页</a></li>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <?php if(app('session')->get('user')): ?>
                <a href="javascript:;">
                    <?php if(app('session')->get('user.img')): ?>
                    <img src="/uploads/<?php echo htmlentities(app('session')->get('user.img')); ?>" class="layui-nav-img">
                    <?php else: ?>
                    <img src="/static/img/头像默认.png" class="layui-nav-img">
                    <?php endif; ?>
                    <?php echo htmlentities(app('session')->get('user')->userinfo->realname); ?>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                    <dd><a href="">切换账号</a></dd>
                </dl>
                <?php else: ?>
                <a href="<?php echo url('login'); ?>">登录</a>
                <?php endif; ?>
            </li>
            <li class="layui-nav-item">
                <?php if(app('session')->get('user')): ?>
                <a href="<?php echo url('logout'); ?>">注销</a>
                <?php else: ?>
                <a href="<?php echo url('regist'); ?>">注册</a>
                <?php endif; ?>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li id="lab_app" class="layui-nav-item">
                    <a class=""  href="javascript:;">实验室预约</a>
                    <dl class="layui-nav-child">
                        <dd><a href="<?php echo url('lab_empty'); ?>">空实验室</a></dd>
                        <!--<dd><a href="javascript:;">列表二</a></dd>-->
                    </dl>
                </li>
                <li id="tool_app" class="layui-nav-item">
                    <a href="javascript:;">器具租借</a>
                    <dl class="layui-nav-child">
                        <dd><a href="<?php echo url('tool_small_app'); ?>">小型器具借用申请</a></dd>
                        <dd><a href="<?php echo url('tool_big_app'); ?>">大型器具借用申请</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item" id="lab_yuyue">
                    <a href="javascript:;">预约进度</a>
                    <dl class="layui-nav-child">
                        <dd id="now_yuyue"><a href="<?php echo url('lab_app_list'); ?>">课室当前预约</a></dd>
                        <dd id="old_yuyue"><a href="<?php echo url('lab_history_list'); ?>">课室历史预约</a></dd>
                        <dd id="tool_yuyue"><a href="<?php echo url('tool_list'); ?>">器具借用进度</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item" id="teacher_list"><a href="<?php echo url('teacher_list'); ?>">联系教师</a></li>
                <li class="layui-nav-item" id="notice"><a href="<?php echo url('notice'); ?>">公告消息</a></li>
                <li class="layui-nav-item" id="feedback"><a href="<?php echo url('feedback'); ?>">问题反馈</a></li>
                <li class="layui-nav-item" id="about_me"><a href="<?php echo url('about_me'); ?>">关于我的</a></li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
<div style="padding: 20px;">
    <div style="background: #FFFFFF;padding: 20px 50px;">
        <div class="layui-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">基本资料</li>
                <li>修改头像</li>
                <li>修改密码</li>
                <li>我的反馈</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label for="" class="layui-form-label">
                            <span class="layui-icon layui-icon-username">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>姓名:
                        </label>
                        <div class="layui-form-mid" id="old_realname">
                            <?php echo htmlentities(app('session')->get('user')->userinfo->realname); ?>
                        </div>
                        <div class="layui-input-inline">
                            <input id="realname" type="text" class="layui-input" value="<?php echo htmlentities(app('session')->get('user')->userinfo->realname); ?>">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="" class="layui-form-label">
                            <span class="layui-icon layui-icon-cellphone">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>手机:
                        </label>
                        <div class="layui-form-mid" id="old_tel">
                            <?php echo htmlentities((app('session')->get('user')->userinfo->tel ?: "尚未上传手机号")); ?>
                        </div>
                        <div class="layui-input-inline">
                            <input id="tel" type="text" class="layui-input" value="<?php echo htmlentities(app('session')->get('user')->userinfo->tel); ?>">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="" class="layui-form-label">
                            <span class="layui-icon layui-icon-list">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>邮箱:
                        </label>
                        <div class="layui-form-mid" id="old_email">
                            <?php echo htmlentities(app('session')->get('user')->userinfo->email); ?>
                        </div>
                        <div class="layui-input-inline">
                            <input id="email" type="text" class="layui-input" value="<?php echo htmlentities(app('session')->get('user')->userinfo->email); ?>">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="" class="layui-form-label">
                            <span class="layui-icon layui-icon-user">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>学号:
                        </label>
                        <div class="layui-form-mid">
                            <?php echo htmlentities(app('session')->get('user.username')); ?>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="" class="layui-form-label">
                            <span class="layui-icon">&#xe637;</span>加入时间:
                        </label>
                        <div class="layui-form-mid">
                            <?php echo htmlentities(app('session')->get('user.create_time')); ?>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button id="update" class="layui-btn">修改</button>
                            <button id="cancel" class="layui-btn layui-btn-primary">取消</button>
                            <button id="enter" class="layui-btn layui-btn-normal">确定</button>
                        </div>
                    </div>
                </div>

                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <?php if(app('session')->get('user.img')): ?>
                        <img src="/uploads/<?php echo htmlentities(app('session')->get('user.img')); ?>" alt="" width="150px" height="150px"><br>
                        <?php else: ?>
                        <img src="/static/img/头像默认.png" alt="" width="150px" height="150px"><br>
                        <?php endif; ?>
                        <br>
                        <button type="button" class="layui-btn" id="upload">
                            <i class="layui-icon">&#xe67c;</i>上传图片
                        </button>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <div class="layui-form-item">
                        <label for="" class="layui-form-label">原密码：</label>
                        <div class="layui-input-inline">
                            <input type="password" class="layui-input" id="oldpassword">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="" class="layui-form-label">新密码：</label>
                        <div class="layui-input-inline">
                            <input type="password" class="layui-input" id="newpassword">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="" class="layui-form-label">确认密码：</label>
                        <div class="layui-input-inline">
                            <input type="password" class="layui-input" id="newpassword1">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                        <button class="layui-btn" onclick="password_change()">确认修改</button>
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <ul>
                        <?php if(is_array($feedbacks) || $feedbacks instanceof \think\Collection || $feedbacks instanceof \think\Paginator): $i = 0; $__LIST__ = $feedbacks;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$feedback): $mod = ($i % 2 );++$i;?>
                        <li>
                            <div class="list_top">
                                <?php if($feedback->user->img): ?>
                                <img src="/uploads/<?php echo htmlentities($feedback->user->img); ?>" alt="" width="60px" height="60px">
                                <?php else: ?>
                                <img src="/static/img/头像默认.png" alt="" width="60px" height="60px">
                                <?php endif; ?>
                                <div>
                                    <p style="color: #599CD1"><?php echo htmlentities($feedback->user->user_info->realname); ?></p>
                                    <p style="color: #353535"><?php echo htmlentities($feedback->create_time); ?></p>
                                </div>
                            </div>
                            <div>
                                <?php echo $feedback['content']; ?>
                            </div>
                            <?php if($feedback['return']): ?>
                            <div class="return" >
                                已回复:
                                <?php echo htmlentities($feedback['return']); ?>
                            </div>
                            <?php else: ?>
                            <div class="false_return" >
                                尚未回复
                            </div>
                            <?php endif; ?>
                        </li>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </ul>
                </div>
            </div>
        </div>
    </div>

</div>
</div>

<div class="layui-footer">
    <!-- 底部固定区域 -->
    Copyright-2018-实验室管理系统网
</div>
</div>
<script>
    //JavaScript代码区域
    layui.use('element', function() {
        var element = layui.element;

    });
</script>
</body>
</html>

<script>
    $('#realname').hide();
    $('#tel').hide();
    $('#email').hide();
    $('#cancel').hide();
    $('#enter').hide();

    $('#update').click(function () {
        $(this).hide();
        $('#old_realname').hide();
        $('#old_tel').hide();
        $('#old_email').hide();
        $('#realname').show();
        $('#tel').show();
        $('#email').show();
        $('#cancel').show();
        $('#enter').show();
    });
    $('#cancel').click(function () {
        $(this).hide();
        $('#old_realname').show();
        $('#old_tel').show();
        $('#old_email').show();
        $('#realname').hide().val('<?php echo htmlentities(app('session')->get('user')->userinfo->realname); ?>');
        $('#tel').hide().val('<?php echo htmlentities(app('session')->get('user')->userinfo->tel); ?>');
        $('#email').hide().val('<?php echo htmlentities(app('session')->get('user')->userinfo->email); ?>');
        $('#enter').hide();
        $('#update').show();
    });
    $('#enter').click(function () {
       $.post(
           "<?php echo url('update_message'); ?>",
        {
            realname:$('#realname').val(),
            tel:$('#tel').val(),
            email:$('#email').val()
        },
        function (data){
            if (data.statu==200){
                layer.msg(data.msg,function () {
                    window.location.reload();
                })
            } else {
                layer.msg(data.msg)
            }
        }
       )
    });
    function password_change(){
        $.post(
            "<?php echo url('index/update_password'); ?>",
            {
                oldpassword:$('#oldpassword').val(),
                newpassword:$('#newpassword').val(),
                newpassword1:$('#newpassword1').val()
            },
            function (data) {
                if (data.statu==200){
                    layer.msg(data.msg,function () {
                        window.location.reload();
                    })
                } else {
                    layer.msg(data.msg)
                }
            }
        )
    }
    $('#about_me').addClass("layui-nav-itemed");
    //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function () {
        var element = layui.element;

        //…
    });
    layui.use('upload', function(){
        var upload = layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '#upload' //绑定元素
            ,url: "<?php echo url('upload_icon'); ?>" //上传接口
            ,done: function(res){
                //上传完毕回调
                if (res.statu==200){
                    layer.msg(res.msg);
                    $('img').attr('src','/uploads/'+res.path);
                } else {
                    layer.msg(res.msg);
                }
            }
            ,error: function(){
                //请求异常回调
            }
        });
    });
</script>
<style>
    .layui-tab-item ul {
        /*width: 70%;*/
        padding: 20px;
        border: 1px solid #EFEFEF;

        box-shadow: 2px 4px 8px #EFEFEF;
    }

    .layui-tab-item li {
        padding: 10px 0px;
        border-bottom: 1px solid #EFEFEF;
    }

    .list_top {
        display: flex;
        margin-bottom: 10px;
    }

    .list_top div {
        margin-left: 20px;
        line-height: 28px;
    }
    .return {
        background: #F2F3F4;
        margin-top: 10px;
        color: #666;
    }
    .false_return{
        margin-top: 10px;
        color: darkred;
    }
    .return p{
        color: #353535;
    }
</style>